Release 10.1A: OpenEdge Development:
ProDataSets
Changing the window procedure to use the new procedures
You can test these new procedures with a window procedure very much like
dsOrderWinUpd.w.
![]()
To update the code:
- Copy
dsOrderWinUpd.wtodsOrderWinAdv.w(advfor “advanced”).- Add this new Definition to it. This is the handle of the
Orderentity. This is now a persistent procedure, rather than runningOrderSupport.pas a standalone.p:
- Change the Main Block to run
OrderEntity.pas a persistent procedure:
- Change the
CLOSEtrigger in the Main Block to give theOrderentity procedure a chance to clean up:
- In the
LEAVEtrigger foriOrderNum, change the run ofOrderMain.pto runfetchOrderin theOrderentity procedure:
Note that the
OUTPUTDATASETdsOrderparameter is not passedBY-REFERENCE, and should not be. IfOrderEntity.pwere running in a separate session, it would be ignored and would make no difference. But when it is running in the same session, you want the ProDataSet that is initialized, attached, and returned byfetchOrderto be the one the client uses, not the client’s locally defined ProDataSet, which is not attached to any Data-Sources.- In the
CHOOSEtrigger forBtnSave, remove the code that is now inclientChanges.pso that the trigger is reduced to this:
You can see how much of what this trigger does has been replaced by the generic support procedure
clientChanges.p.That’s it. If you save this and run it, it should work exactly as it did before, with much less code in the client procedure and much less code in the support procedures because of
clientChanges.pandcommitChanges.p. Also, yourOrdersupport logic has been better organized into procedures that do specific parts of the job in ways that you can use as a standard for other ProDataSets.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |